IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spTusers_RetrieveAll')
	BEGIN
		PRINT 'Dropping Procedure spTusers_RetrieveAll'
		DROP  Procedure  spTusers_RetrieveAll
	END

GO

PRINT 'Creating Procedure spTusers_RetrieveAll'
GO

CREATE Procedure spTusers_RetrieveAll
	(
		@TUSER char() = null, 
		@PASSWORD char() = null, 
		@ACCESS text = null, 
		@NAME char() = null
	)
AS
    /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 8/23/2007	Initial version created
    ------------------------------------------------------------------------------
    */
	
	SET NOCOUNT ON
	
	-- Retrieve the relevant records
	SELECT  *
	FROM	Tusers
	
	WHERE	(@TUSER IS NULL OR Tusers.TUSER = @TUSER)
	  AND	(@PASSWORD IS NULL OR Tusers.PASSWORD = @PASSWORD)
	  AND	(@ACCESS IS NULL OR Tusers.ACCESS = @ACCESS)
	  AND	(@NAME IS NULL OR Tusers.NAME = @NAME)

	-- Return to calling method
	RETURN
GO
